#[must_use]
pub fn goldbach_conjecture() -> u64 {
    11770
}

#[cfg(test)]
mod tests {
    fn is_prime(x: u32) -> bool {
        crate::shared::primes::miller_rabin(u128::from(x))
    }

    #[test]
    fn find_answer() {
        let mut ans: Vec<u32> = Vec::new();

        for x in 3..10_000_000 {
            if x % 2 == 0 || is_prime(x) {
                continue;
            }
            // 奇合数

            // x = p + a*a*2
            let mut flag = false;
            for a in 1..x {
                if a * a * 2 > x {
                    break;
                }
                if is_prime(x - a * a * 2) {
                    flag = true;
                    break;
                }
            }

            if !flag {
                ans.push(x);
                if ans.len() == 2 {
                    break;
                }
            }
        }
        eprintln!("ans = {ans:?}");
        eprintln!("ans[0] + ans[1] = {}", ans[0] + ans[1]);
    }
}
